home *** CD-ROM | disk | FTP | other *** search
- AUTOMATON*
-
- Tron
-
- A two state automaton using the Margolus neighbourhood. As with 'Critter',
- most cells reverse their state at each generation, producing a flashing
- display; careful choice of colours prevents this from being too garish. Try
- 200x100 & 100x50 windows. Tron is a reversible self inverse automaton -
- altering phase at any stage, then resuming, causes the automaton to undo
- it's previous behaviour.
-
- INITIALISATION*
-
- 10DEF PROCdo
- 20*SetEval wrap on
- 30*SetEval neig margolus
- 40*SetEval i 64
- 50*SetEval b 10
- 60ENDPROC
-
- SCREEN*
-
- 10DEF PROCdo
- 20DIM buf% 256:SYS "OS_ReadVarVal","sux",buf%,256:sux%=4*!buf%
- 30SYS "OS_ReadVarVal","suy",buf%,256:suy%=4*!buf%
- 40SYS "OS_ReadVarVal","i",buf%,256
- 50c%=FNacol(!buf%):GCOL c%AND63 TINT c%
- 60SYS "OS_ReadVarVal","b",buf%,256
- 70c%=FNacol(!buf%):GCOL 128+(c%AND63) TINT c%:CLG
- 80FOR Q%=1 TO RND(2)
- 90RECTANGLE RND(sux%)-sux%/2,RND(suy%)-suy%/2,RND(sux%),RND(suy%)
- 100NEXT
- 110ENDPROC
-
- CODE*
-
- ( READ_NEIG
- <i> SCOUNT_ALL DUP 0 = IF (<i> ==)
- 4 = IF (<b> ==)
- CELL == )
-
- END*